import akshare as ak


def DaPanZiJinLiuLu(t):
    stock_market_fund_flow_df = ak.stock_market_fund_flow()
    stock_market_fund_flow_dict=stock_market_fund_flow_df.to_dict()
    shuju=[]
    num=len(stock_market_fund_flow_dict["日期"])
    for i in range(t):
        n=num-i-1
        zijinliuxiang={}
        zijinliuxiang['日期']=stock_market_fund_flow_dict["日期"][n]
        zijinliuxiang['上证-收盘价']=stock_market_fund_flow_dict["上证-收盘价"][n]
        zijinliuxiang['上证-涨跌幅']=stock_market_fund_flow_dict["上证-涨跌幅"][n]
        zijinliuxiang['主力净流入-净额']=stock_market_fund_flow_dict["主力净流入-净额"][n]
        zijinliuxiang['主力净流入-净占比']=stock_market_fund_flow_dict["主力净流入-净占比"][n]
        zijinliuxiang['超大单净流入-净额']=stock_market_fund_flow_dict["超大单净流入-净额"][n]
        zijinliuxiang['超大单净流入-净占比']=stock_market_fund_flow_dict["超大单净流入-净占比"][n]
        zijinliuxiang['大单净流入-净额']=stock_market_fund_flow_dict["大单净流入-净额"][n]
        zijinliuxiang['大单净流入-净占比']=stock_market_fund_flow_dict["大单净流入-净占比"][n]
        zijinliuxiang['中单净流入-净额']=stock_market_fund_flow_dict["中单净流入-净额"][n]
        zijinliuxiang['中单净流入-净占比']=stock_market_fund_flow_dict["中单净流入-净占比"][n]
        zijinliuxiang['小单净流入-净额']=stock_market_fund_flow_dict["小单净流入-净额"][n]
        zijinliuxiang['小单净流入-净占比']=stock_market_fund_flow_dict["小单净流入-净占比"][n]
        zijinliuxiang['total']=zijinliuxiang['主力净流入-净额']+zijinliuxiang['超大单净流入-净额']+zijinliuxiang['大单净流入-净额']+zijinliuxiang['中单净流入-净额']+zijinliuxiang['小单净流入-净额']
        shuju.append(zijinliuxiang)
    print(shuju)
    return shuju

if __name__ == '__main__':
    a=DaPanZiJinLiuLu(30)
    print(a)
    print(len(a))



